import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    name:'Login',
    component: () => import('../views/Login.vue'), // 页面路由的按需引入
  },
  {
    path:'/Main',
    name:'Main',
    component: () => import('../views/Main.vue'), // 页面路由的按需引入
    children:[
      {
        path:'/home',
        name:'home',
        component: () => import('../views/home')
      },
      {
        path:'/user',
        name:'user',
        component: () => import('../views/user')
      },
      {
        path:'/mall',
        name:'mall',
        component: () => import('../views/mall')
      }
    ]
  }
]

const router = new VueRouter({
  mode:'history',
  routes
})
export default router